﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
using Topshelf;

namespace AppPoolCheckerService {
	static class Program {
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		static void Main() {

            HostFactory.Run(x =>
            {
                x.Service<Service1>(s =>
                {
                    s.ConstructUsing(name => new Service1());
                    s.WhenStarted(tc => tc.Start());
                    s.WhenStopped(tc => tc.Stop());
                });

                x.RunAsLocalSystem();

                x.SetDescription("IIS应用池检测");
                x.SetDisplayName("IIS检测");
                x.SetServiceName("IISAppPoolChecker");
            });  
		}
	}
}
